package com.yb.xczx.rabbitmq.message.manager.api;

import com.yb.core.model.message.XczxMessage;
import com.yb.xczx.message.manager.api.XczxMessageManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/5/9 14:09
 * FileName: RabbitMQMessageManager
 * Description:
 */
@Slf4j
public class XczxRabbitMQMessageManager implements XczxMessageManager {

    RabbitTemplate rabbitTemplate;

    public XczxRabbitMQMessageManager(RabbitTemplate rabbitTemplate){
        this.rabbitTemplate=rabbitTemplate;
    }

    @Override
    public  void convertAndSend(XczxMessage message) {
        rabbitTemplate.convertAndSend(message.getContent());
    }
}
